package scoder.store;

import scoder.pizza.Pizza;
import scoder.factory.PizzaIngredientFactory;

public abstract class PizzaStore {

    protected PizzaIngredientFactory factory;

    protected abstract Pizza createPizza(String type);

    public Pizza orderPizza(String type) {
        Pizza pizza = null;

        pizza = createPizza(type);
        if (null != pizza) {
            pizza.prepare();
            pizza.bake();
            pizza.cut();
            pizza.box();
        }

        return pizza;
    }
}
